Integrand size = 31, antiderivative size = 160 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {1}{2} a^4 (13 A+8 B) x+\frac {a^4 (8 A+13 B) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {5 a^4 (A-B) \sin (c+d x)}{2 d}+\frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(A+6 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \]
[Out]
Time = 0.42 (sec) , antiderivative size = 160, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4102, 4103, 4081, 3855} \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {a^4 (8 A+13 B) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {5 a^4 (A-B) \sin (c+d x)}{2 d}+\frac {(A+6 B) \sin (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{2 d}+\frac {1}{2} a^4 x (13 A+8 B)-\frac {(A-B) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 d}+\frac {a A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^3}{2 d} \]
[In]
[Out]
Rule 3855
Rule 4081
Rule 4102
Rule 4103
Rubi steps \begin{align*} \text {integral}& = \frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}+\frac {1}{2} \int \cos (c+d x) (a+a \sec (c+d x))^3 (a (5 A+2 B)-2 a (A-B) \sec (c+d x)) \, dx \\ & = \frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {1}{4} \int \cos (c+d x) (a+a \sec (c+d x))^2 \left (2 a^2 (6 A+B)+2 a^2 (A+6 B) \sec (c+d x)\right ) \, dx \\ & = \frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(A+6 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {1}{4} \int \cos (c+d x) (a+a \sec (c+d x)) \left (10 a^3 (A-B)+2 a^3 (8 A+13 B) \sec (c+d x)\right ) \, dx \\ & = \frac {5 a^4 (A-B) \sin (c+d x)}{2 d}+\frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(A+6 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{2 d}-\frac {1}{4} \int \left (-2 a^4 (13 A+8 B)-2 a^4 (8 A+13 B) \sec (c+d x)\right ) \, dx \\ & = \frac {1}{2} a^4 (13 A+8 B) x+\frac {5 a^4 (A-B) \sin (c+d x)}{2 d}+\frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(A+6 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {1}{2} \left (a^4 (8 A+13 B)\right ) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} a^4 (13 A+8 B) x+\frac {a^4 (8 A+13 B) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {5 a^4 (A-B) \sin (c+d x)}{2 d}+\frac {a A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-B) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 d}+\frac {(A+6 B) \left (a^4+a^4 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \\ \end{align*}
Leaf count is larger than twice the leaf count of optimal. \(373\) vs. \(2(160)=320\).
Time = 8.93 (sec) , antiderivative size = 373, normalized size of antiderivative = 2.33 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {a^4 \cos ^5(c+d x) \sec ^8\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^4 (A+B \sec (c+d x)) \left (2 (13 A+8 B) x-\frac {2 (8 A+13 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {2 (8 A+13 B) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {4 (4 A+B) \cos (d x) \sin (c)}{d}+\frac {A \cos (2 d x) \sin (2 c)}{d}+\frac {4 (4 A+B) \cos (c) \sin (d x)}{d}+\frac {A \cos (2 c) \sin (2 d x)}{d}+\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+4 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {B}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {4 (A+4 B) \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{64 (B+A \cos (c+d x))} \]
[In]
[Out]
Time = 2.55 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.04
method | result | size |
parallelrisch | \(\frac {2 \left (-2 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {13 B}{8}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+2 \left (1+\cos \left (2 d x +2 c \right )\right ) \left (A +\frac {13 B}{8}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+\frac {13 \left (A +\frac {8 B}{13}\right ) d x \cos \left (2 d x +2 c \right )}{4}+\left (\frac {5 A}{8}+2 B \right ) \sin \left (2 d x +2 c \right )+\left (A +\frac {B}{4}\right ) \sin \left (3 d x +3 c \right )+\frac {A \sin \left (4 d x +4 c \right )}{16}+\left (A +\frac {3 B}{4}\right ) \sin \left (d x +c \right )+\frac {13 \left (A +\frac {8 B}{13}\right ) d x}{4}\right ) a^{4}}{d \left (1+\cos \left (2 d x +2 c \right )\right )}\) | \(166\) |
derivativedivides | \(\frac {a^{4} A \tan \left (d x +c \right )+B \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 B \,a^{4} \tan \left (d x +c \right )+6 a^{4} A \left (d x +c \right )+6 B \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{4} A \sin \left (d x +c \right )+4 B \,a^{4} \left (d x +c \right )+a^{4} A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{4} \sin \left (d x +c \right )}{d}\) | \(177\) |
default | \(\frac {a^{4} A \tan \left (d x +c \right )+B \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 a^{4} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 B \,a^{4} \tan \left (d x +c \right )+6 a^{4} A \left (d x +c \right )+6 B \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 a^{4} A \sin \left (d x +c \right )+4 B \,a^{4} \left (d x +c \right )+a^{4} A \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+B \,a^{4} \sin \left (d x +c \right )}{d}\) | \(177\) |
risch | \(\frac {13 a^{4} A x}{2}+4 a^{4} x B -\frac {i a^{4} A \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{4} A \,{\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i {\mathrm e}^{i \left (d x +c \right )} B \,a^{4}}{2 d}+\frac {2 i a^{4} A \,{\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B \,a^{4}}{2 d}+\frac {i a^{4} A \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {i a^{4} \left (B \,{\mathrm e}^{3 i \left (d x +c \right )}-2 A \,{\mathrm e}^{2 i \left (d x +c \right )}-8 B \,{\mathrm e}^{2 i \left (d x +c \right )}-B \,{\mathrm e}^{i \left (d x +c \right )}-2 A -8 B \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d}-\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d}\) | \(294\) |
norman | \(\frac {\left (\frac {13}{2} a^{4} A +4 B \,a^{4}\right ) x +\left (-\frac {13}{2} a^{4} A -4 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}+\left (-\frac {13}{2} a^{4} A -4 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}+\left (\frac {13}{2} a^{4} A +4 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{12}+\left (-13 a^{4} A -8 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+\left (-13 a^{4} A -8 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}+\left (26 a^{4} A +16 B \,a^{4}\right ) x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+\frac {5 a^{4} \left (A -B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{d}+\frac {11 a^{4} \left (A +B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{4} \left (5 A +9 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {2 a^{4} \left (11 A -7 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{4} \left (17 A -3 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{d}-\frac {a^{4} \left (31 A +13 B \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2} \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}-\frac {a^{4} \left (8 A +13 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{4} \left (8 A +13 B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(407\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 156, normalized size of antiderivative = 0.98 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {2 \, {\left (13 \, A + 8 \, B\right )} a^{4} d x \cos \left (d x + c\right )^{2} + {\left (8 \, A + 13 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (8 \, A + 13 \, B\right )} a^{4} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{4} \cos \left (d x + c\right )^{3} + 2 \, {\left (4 \, A + B\right )} a^{4} \cos \left (d x + c\right )^{2} + 2 \, {\left (A + 4 \, B\right )} a^{4} \cos \left (d x + c\right ) + B a^{4}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]
[In]
[Out]
\[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=a^{4} \left (\int A \cos ^{2}{\left (c + d x \right )}\, dx + \int 4 A \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 6 A \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 4 A \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 4 B \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 6 B \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 4 B \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.22 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.24 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{4} + 24 \, {\left (d x + c\right )} A a^{4} + 16 \, {\left (d x + c\right )} B a^{4} - B a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 8 \, A a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, B a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 16 \, A a^{4} \sin \left (d x + c\right ) + 4 \, B a^{4} \sin \left (d x + c\right ) + 4 \, A a^{4} \tan \left (d x + c\right ) + 16 \, B a^{4} \tan \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
none
Time = 0.35 (sec) , antiderivative size = 230, normalized size of antiderivative = 1.44 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {{\left (13 \, A a^{4} + 8 \, B a^{4}\right )} {\left (d x + c\right )} + {\left (8 \, A a^{4} + 13 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (8 \, A a^{4} + 13 \, B a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (5 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 5 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 7 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 7 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 11 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 11 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 13.55 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.52 \[ \int \cos ^2(c+d x) (a+a \sec (c+d x))^4 (A+B \sec (c+d x)) \, dx=\frac {4\,A\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {13\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,B\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {13\,B\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {4\,B\,a^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {B\,a^4\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {A\,a^4\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d} \]
[In]
[Out]